package com.work.bookstore.mapper;

import com.work.bookstore.pojo.Book;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author ppg007
 * @date 2021/1/1 13:34
 */
@Mapper
@Repository
public interface BookMapper {
    /**
     * 添加Book
     * @param book Book对象
     */
    void addBook(Book book);

    /**
     * 根据分类返回Book
     * @param category 类别
     * @return Book
     */
    List<Book> queryBookByCategory(String category);

    /**
     * 根据书名查找
     * @param name 书名
     * @return Book
     */
    List<Book> queryBookByName(String name);

    /**
     * 根据书号精确查找
     * @param id 书号
     * @return Book对象
     */
    Book queryBookByOrder(int id);
}
